fix(s2n-quic-transport): decrement handshake count for non-accepted finalized connections #1911
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description of changes:
The count of currently handshaking connections in the connection container was not being decremented when a connnection moved from handshaking directly to finalizing. This change corrects this behavior.
Call-outs:
There is a brief moment between when
update_interests()
is called andfinalize_done_connections()
is called when thehandshake_connections
count is technically incorrect. This is because I decided to account for both handshaking connections and handshaking completed connections in theupdate_interests()
method so I would not need to lock the connection multiple times. A connection that is handshaking and finalizing will decrement thehandshake_connections
count, but is not be removed from the connection map untilfinalize_done_connections
is called. This meant I had to callfinalize_done_connections()
prior toensure_counter_consistency()
. I added some debug assertions infinalize_done_connections()
to ensure the accounting is still correct.Testing:
Updated the connection container fuzz test to trigger this scenario
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.